package com.itheima.dao;

import com.itheima.domain.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface UserDao {

    @Insert("insert into user values (id=#{id},name=#{name},money=#{money})")
    public void  save(User user);

    @Delete("delete from user where id=#{id}")
    public void  delete(String id);


    @Update("update  user set name=#{name},money=#{money} where id=#{id}")
    public void  update(User user);


    @Select("select * from user")
    public List<User> findAll();


    @Select("select * from user where id=#{id}")
    public  User findById(String id);


}
